package com.yelobblog.yelobblog.config;


import com.yelobblog.yelobblog.Interceptor.UserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class JWTconfig implements WebMvcConfigurer {
    @Autowired
    private UserInterceptor userInterceptor;
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInterceptor).excludePathPatterns(
                "/user/login",
                "/user/register",
                "/user/sendCode",
                "/articles/list",
                "/articles/listByCategoryId",
                "/articles/get/**",
                "/articles/search",
                "/articles/listByUpdateTime",
                "/articles/listByViewCount",
                "/comment/list/**",
                "/comment/listRoot/**",
                "/logs/getLogs"
        );
    }
}
